/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.TreeMap;
import java.lang.String;
/**
 *
 * @author ppfaff
 */
public class fileFind {
    public TreeMap<Integer, property> properties;
    public TreeMap<Integer, property> agents;
    //TODO make this the main scanner of the listings.txt
public double propValue(){
    return 5.0;
}//returns value of all properties in the treemap
public double agentValue(){
    return 5.0;
}//returns value of all properties listed by agent
public void init() throws FileNotFoundException{
//      Scanner console = new Scanner(System.in);
//      System.out.print("Input file: ");
//      String inputFileName = console.next();
//      System.out.print("Output file: ");
//      String outputFileName = console.next();


//      File inputFile = new File(inputFileName);
      Scanner input = new Scanner(new File("listings.txt"));
//      PrintWriter out = new PrintWriter(outputFileName);
      agents = new TreeMap<Integer, property>();
      properties = new TreeMap<Integer, property>();
      while(input.hasNextLine())//<editor-fold> 
          {
         
          int propertyNumber = input.nextInt();    
          System.out.print(propertyNumber+" = PropNumber, ");
        
       
          String propertyType = input.next();
          System.out.print(propertyType.toUpperCase()+" = PropType, ");
          
          double propertyValue = input.nextDouble();    
          System.out.print(propertyValue+" = PropValue, ");
      
          int agentID = input.nextInt();
          System.out.print(agentID+" = Agent ID,\n");
          input.nextLine();
          
          property propertyNew = new property(propertyNumber, propertyType.toUpperCase(), propertyValue, agentID);
          properties.put(agentID, propertyNew);
          agents.put(agentID, propertyNew);
      } //</editor-fold> //reads input, makes objects, sticks them into maps
      input.close();
//      out.close();
      System.out.println("Reached End");
} // Starts up and finds the file to input
}
